import request from '@/utils/request'

export default {
    // 获取设备预约分页
    deviceReservationPage(data) {
        return request({
            url: '/biz/devicereservation/page',
            method: 'GET',
            data: data
        })
    },
    // 提交设备预约表单 add为false时为编辑，默认为新增
    deviceReservationSubmitForm(data, add = true) {
        return request({
            url: '/biz/devicereservation/' + (add ? 'add' : 'edit'),
            method: 'POST',
            data: data
        })
    },
    // 删除设备预约
    deviceReservationDelete(data) {
        return request({
            url: '/biz/devicereservation/delete',
            method: 'POST',
            data: data
        })
    },
    // 获取设备预约详情
    deviceReservationDetail(data) {
        return request({
            url: '/biz/devicereservation/detail',
            method: 'GET',
            data: data
        })
    },
    // 获取指定日期、时间段和设备类型下已预约的设备
    getReservedDevices(data) {
        return request({
            url: '/biz/devicereservation/getReservedDevices',
            method: 'GET',
            data: data
        })
    },
}
